package hngc.com;

import java.util.Scanner;

public class Box15 {
    public static void main(String[] args) {
        int x = 0;
        int y = 0;
        int a = 0;
        Scanner scanner = new Scanner(System.in);
        System.out.println("输入x值");
        while (scanner.hasNext()) {
            try {
                x = scanner.nextInt();
                System.out.println("输入y值");
                y = scanner.nextInt();
                break;
            } catch (Exception e) {
                System.out.println("输入不符合规范");
                return;
            }
        }
        while (x>0){
            if(y==0){
                x=y+1;
                System.out.println("x=y+1的值:"+x);
                break;
            }else {
                if(y==1){
                    a=y+10;
                    System.out.format("a=y+10的值:%d\n",a);
                    x=x-1;
                    System.out.println("x=x-1的值:"+x);
                }else {
                    a=y+20;
                    System.out.format("a=y+20的值:%d\n",a);
                    x=x-1;
                    System.out.println("x=x-1的值:"+x);
                }
            }
        }
        x=x+1;
        System.out.println("x=x+1的值:"+x);
        scanner.close();
    }
}
